﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Drawing;

namespace Paint
{
    class Controller
    {        
        public void Draw(int Function, Object obj)
        {
            if (Function == 1)
            {
                VeTuDo vtd = (VeTuDo)obj;
                vtd.VeHinh();
                //vtd.HienThiHinh();
            }
            else if (Function == 2)
            {
                ToMau tm = (ToMau)obj;
                tm.FloodFill(tm.Bimap, tm.DiemDau.X, tm.DiemDau.Y, tm.Color);
            }
            else if (Function == 5)
            {
                DuongThang dt = (DuongThang)obj;
                dt.VeHinh();
            }
            else if (Function == 6)
            {
                HinhTron ht = (HinhTron)obj;
                ht.VeHinh();
            }
            else if (Function == 7)
            {
                HinhVuong hvu = (HinhVuong)obj;
                hvu.VeHinh();
            }
            else if (Function == 8)
            {
                HinhChuNhat hcn = (HinhChuNhat)obj;
                hcn.VeHinh();
            }
        }

        public void Change(int Function, Object obj1, Object obj2)
        {
            if (Function == 9)
            {
                HinhVe hv = (HinhVe)obj1;
                hv.ChangeColor(hv,(Color)obj2);
            }
            else if (Function == 10)
            {
                HinhVe hv = (HinhVe)obj1;
                hv.ChangeWeight(hv,(int)obj2);
            }
            else if (Function == 11)
            {
                VietChu vc = (VietChu)obj1;
                vc.ChangeFont(vc,(string)obj2);
            }
            else if (Function == 12)
            {
                VietChu vc = (VietChu)obj1;
                vc.ChangeSize(vc, (int)obj2);
            }
            else if (Function == 13)
            {
                VietChu vc = (VietChu)obj1;
                vc.ChangeColor(vc, (Color)obj2);
            }

        }
    }
}
